#ifndef _READSENSER_H
#define _READSENSER_H

#include "stdint.h"

// 单位类型
typedef enum _PressureSenserUnit_e
{
    Mpa_e = 0,
    Kpa_e = 1,
    Pa_e = 2,
    Bar_e = 3,
    Mbar_e = 4,
    kgpcm2,
    psi,
    mh2o,
    mmh2o,

    Voltage = 0xFF,
} PressureSenserUnit_e;

// 小数点类型
typedef enum _PressureSenserDot_e
{
    xxxxd = 0,
    xxxdx,
    xxdxx,
    xdxxx,
    dxxxx,
} PressureSenserDot_e;

// 压力表类型
typedef enum _PressureSenserType_e
{
    Type_gauge = 0,
    Type_abs,
} PressureSenserType_e;

// 数据类型结构体
typedef struct _DataStr_s
{
    uint8_t address;
    PressureSenserUnit_e unit;
    PressureSenserDot_e dot;
    PressureSenserType_e type;
    int16_t rawData;
    float data;
} DataStr_s;

float ReadSenserData_float(void);
float ReadADCData_float(void);
void UARTReceiveCallback(void);
void ReadSenserCycleCallback(void);
void ReadADCCycleCallback(void);
void PressureSenserInit(void);

#endif
